const state = {
	appMainHeight: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, // 浏览器可视高度
	headerHeiht: 50, // 头部组件高度
	systemListHeight: 0, // 系统列表组件高度
	appMainPadding: 20, // 容器padding
	tagsViewHeihght: 50, // tagsView组件高度
	menuWidth: 200, // 菜单栏宽度
	menuDisplay: false
}

const mutations = {
	SET_APPMAINHEIGHT: (state: any, height: number) => {
		state.appMainHeight = height
	},
	SET_MENUWIDTH: (state: any, width: number) => {
		state.menuWidth = width
	},
	SET_SYSTEMLISTHEIGHT: (state: any, h: number) => {
		state.systemListHeight = h
	},
	SET_MENUDISPLAY: (state: any) => {
		state.menuDisplay = !state.menuDisplay
	}
}

const actions = {
	setAppManHeight({ commit }: any) {
		let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
		commit('SET_APPMAINHEIGHT', height)
	},
	setMenuWidth({ commit }: any, w: number) {
		commit('SET_MENUWIDTH', w)
	},
	setSystemListHeight({ commit }: any, h: number) {
		commit('SET_SYSTEMLISTHEIGHT', h)
	},
	setMenuDisplay({ commit }: any) {
		commit('SET_MENUDISPLAY')
	}
}

export default {
	namespaced: true,
	state,
	mutations,
	actions
}
